package org.hegang.design.first.staticproxy;

/**
 * @Classname: WeddingCompany
 * @Description: 婚庆公司（代理对象），可以在执行真实对象前后操作更多东西
 * @Date: 2021/3/28 23:16
 * @Author: gang.he
 * @Email: SmileSkylife@outlook.com
 * @Modified_By: TODO
 * @Version: v1.0.0
 */
public class WeddingCompany implements Marry {
    /**
     * 用于代理真实对象
     */
    private Marry target;

    public WeddingCompany(Marry marry){
        this.target = marry;
    }

    @Override
    public void HelloMarry() {
        before();
        this.target.HelloMarry();
        after();
    }

    private void after() {
        System.out.println("结婚后，收尾款！");
    }

    private void before() {
        System.out.println("结婚前，布置现场！");
    }
}
